using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace SailHero.Soft.FrameWork.Models.Mapping.AUTHCODEDBORA
{
    public class SYS_SOFTWAREMap : EntityTypeConfiguration<SYS_SOFTWARE>
    {
        public SYS_SOFTWAREMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.SOFTNO)
                .HasMaxLength(50);

            this.Property(t => t.SOFTCNAME)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.SOFTENAME)
                .HasMaxLength(30);

            this.Property(t => t.PARTENTID)
                .HasMaxLength(50);

            this.Property(t => t.SOFTMANAGER)
                .HasMaxLength(50);

            this.Property(t => t.TELEPHONE)
                .HasMaxLength(50);

            this.Property(t => t.FAX)
                .HasMaxLength(50);

            this.Property(t => t.ISENABLE)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.REMARK)
                .HasMaxLength(100);

            this.Property(t => t.CREATOR)
                .HasMaxLength(50);

            this.Property(t => t.UPDATEUSER)
                .HasMaxLength(50);

            this.Property(t => t.DOWNLOADPATH)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("SYS_SOFTWARE", "LYHADMIN");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SOFTNO).HasColumnName("SOFTNO");
            this.Property(t => t.SOFTCNAME).HasColumnName("SOFTCNAME");
            this.Property(t => t.SOFTENAME).HasColumnName("SOFTENAME");
            this.Property(t => t.PARTENTID).HasColumnName("PARTENTID");
            this.Property(t => t.SOFTMANAGER).HasColumnName("SOFTMANAGER");
            this.Property(t => t.TELEPHONE).HasColumnName("TELEPHONE");
            this.Property(t => t.FAX).HasColumnName("FAX");
            this.Property(t => t.ORDERNUM).HasColumnName("ORDERNUM");
            this.Property(t => t.ISENABLE).HasColumnName("ISENABLE");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
            this.Property(t => t.CREATOR).HasColumnName("CREATOR");
            this.Property(t => t.CREATEDATE).HasColumnName("CREATEDATE");
            this.Property(t => t.UPDATEUSER).HasColumnName("UPDATEUSER");
            this.Property(t => t.UPDATEDATE).HasColumnName("UPDATEDATE");
            this.Property(t => t.DOWNLOADPATH).HasColumnName("DOWNLOADPATH");
        }
    }
}
